begintownscript;
variables;
short choice,i,random;

body;
beginstate init_state;
i = 0;
while(char_ok(i) == 0){
	i = i + 1;
}
reset_dialog();
add_dialog_str(0,"The sun was low in the sky when I reached the end of the trail. It was a large stone building-- a church of some sort.",0);
add_dialog_str(1,"Sly had found the aid he needed. Well he wasn't leaving any time soon, and he wouldn't be leaving without me seeing. There was no point in rushing-- I was still fatigued from my fight and in need of rest.",0);
add_dialog_str(2,"So I settled down in a nearby tree where I had a good vantage of the front door of the church, and rested.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
play_sound(96);
message_dialog("I didn't stir from there until after night had set in. I made my way around the church, staking out the place. There was only one entrance, the front door that I'd been watching.","It was time to find Sly and finish this. It was past midnight, and the white robed priests that I had seen through the windows earlier were hopefully asleep."); 
set_character_facing(i,0);
force_instant_terrain_redraw();
break;

beginstate exit_state;
break;

beginstate start_state;
if((num_chars_in_group(1) == 0) && (get_flag(201,4) == 0)){
	set_flag(201,4,1);
	message_dialog("The last priest fell to the floor. I had tried not to kill them, but when it's seven on one it's hard to remain too concerned about not inflicting a mortal blow.","They were pretty bad off, but not yet dead. I took solace in that, then turned away to continue my search for Sly.");
}
break;

beginstate 10;
if(get_flag(201,0) == 0)
	message_dialog("The doors had been left unlocked. This church certainly felt secure, considering the banditry in the area.","");
set_flag(201,0,1);
break;

beginstate 11;
if(get_flag(201,2) == 0){
	message_dialog("I was trying to avoid detection. Walking right into the dining hall wasn't going to help.","");
	block_entry(1);
}
if((get_flag(201,3) > 0) && (get_flag(201,4) == 0)){
	block_entry(1);
	message_dialog("I didn't have any reason to want to harm these priests, but they were intent on getting in my way. I would deal with them, even if I didn't like it.","");
}
break;

beginstate 12;
message_dialog("The storage cellar. Not exactly what I was looking for...","");
block_entry(1);
break;

beginstate 13;
if(get_flag(201,2) == 0){
	message_dialog("No such luck. A voice from the dining hall to the east called out. _Hey! Friend! What brings you here so late? Here, come and share a bite with us, there's enough to go around._","I cursed under my breath, but had no choice but to approach the dining hall. Perhaps I could talk my way out of it.");
	set_flag(201,2,1);
}
break;

beginstate 14;
if(get_flag(201,1) == 0)
	message_dialog("The sign over the door read _Chapel of Compassion._ I'd never heard of it before, but apparently they had some money to be able to afford these tiled floors and stone walls.","The double doors to the east were flung open, and sounds of merriment could be heard. I proceeded cautiously, not wanting to be spotted.");
set_flag(201,1,1);
break;

beginstate 15;
if(get_flag(201,3) == 0)
	begin_talk_mode(1);
break;

beginstate 16;
if(get_flag(201,5) == 0){
	set_flag(201,5,1);
	activate_hidden_group(1);
	erase_char(18);
	set_char_dialogue_pic(7,306,0);
}
break;

beginstate 17;
if(get_flag(201,4) == 0){
	block_entry(1);
	message_dialog("_I insist, brother! Come and share a bite with us._ The voice from the dining room called again.","");
}
break;

beginstate 18;
erase_char(14);
change_spec_item(3,1);
message_dialog("The priest fought to his last breath. Even as he fell I realized he was already dead.","I knelt to take the key that he'd used to lock the door from his belt. Finally I'd reached Sly.");
break;

beginstate 19;
if(get_flag(201,6) == 0)
	message_dialog("The room was empty.","");
set_flag(201,6,1);
break;

beginstate 20;
if(get_flag(201,7) == 0){
	reset_dialog();
	add_dialog_str(0,"I cursed to myself as I approached the end of the room. The curtains covering one of the windows were gently stirring-- I whipped them back to find that the window was open.",0);
	add_dialog_str(1," A tall pine tree no more than three feet away from the wall would provide the perfect way down.",0);
	add_dialog_str(2,"The sheets on the bed beneath the window were rumpled and looked like they'd just been slept on. Sly has been here-- but he'd slipped away again.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(201,7,1);
	activate_hidden_group(4);
	set_name(16,"Priestess");
	set_name(15,"High Priest");
	set_character_pose(15,14);
	put_stain_on_space(13,23,2);
	force_instant_terrain_redraw();
}
break;

beginstate 21;
if((get_flag(201,7) > 0) && (get_flag(201,8) == 0)){
	set_flag(201,8,1);
	message_dialog("A young woman crouched beside the body of the fallen priest. She was crying quietly, and cradled his head in her lap.","I walked past without halting.");
} 
break;

beginstate 22;
message_dialog("These doors were locked.","");
block_entry(1);
break;

beginstate 23;
if((get_flag(201,7) > 0) && (get_flag(201,9) == 0)){
	message_dialog("I heard the sound of running footsteps from behind. I turned just in time to see a white robed woman leaping down the last set of stairs.","It was the priestess from upstairs. As she hit the ground she snatched a torch from the sconce on the nearby wall, and brandished it as she advanced on me. She had a wild look in here eyes, and her face was stained with tears.");
	activate_hidden_group(5);
	message_dialog("_You-- you have taken everything from me. Why-- why did you do this? Why could you not leave us in peace? What did Father Kay ever do to anyone?_","She swung the torch with all her weight and anger behind it. I ducked, sending her staggering past.");
	set_strategy(17,0); 
	set_flag(201,9,1);
}
break;

beginstate 24;
erase_char(17);
reset_dialog();
add_dialog_str(0,"The priestess lay on the ground, exhausted but not wounded. She was a pretty thing-- it had pained me to harm her, but I had kept from wounding her severely. She sobbed silently, but was now too weak to stand let alone take out her anger on me.",0);
add_dialog_str(1,"Her torch-turned-club had rolled from her hand. Its flame was creeping up the tapestry that hung above it, and was rapidly spreading up into the wooden rafters.",0);
add_dialog_str(2,"_I hate you-- I hate you both._ She gasped. The smoke was growing thick, the chapel was about to go up like a matchbook. It was time for me to leave.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
relocate_character(i,23,43);
set_character_facing(i,4);
force_view_center(23,43);
force_instant_terrain_redraw();
set_flag(201,10,1);
break;

beginstate 25;
if(get_flag(201,10) == 0){
	block_entry(1);
	message_dialog("The church was where Sly had taken refuge. I had to search him out.","");
}
else{
	message_dialog("The trail had gone cold. I could find no trace of Sly and didn't have the slightest idea what way he was now headed.","I decided to head towards Cigosal. That was clearly where Sly had been headed originally, hopefully he had continued in that direction.");
	move_to_new_town(22,24,45);
	//move_to_new_town(2,24,45);
}
break;

beginstate 26;
if(get_flag(201,5) < 2)
	block_entry(1);
break;

beginstate 100;
block_entry(1);
break;

beginstate 101;
message_dialog("Hmmm.... That's not how I remember it.","");
end_scenario(1);
break;

beginstate 102;
//
break;

beginstate 103;
if(get_flag(201,9) > 0){
	message_dialog("There was no reason to stay here any longer.","");
	block_entry(1);
}
break;

beginstate 104;
if(get_flag(201,9) > 0)
	block_entry(1);
else
	end();
if(get_flag(201,10) == 0)
	message_dialog("This priestess didn't know much about combat, but if I turned my back to her she'd likely dash my brains out with that club.","");
else
	message_dialog("There was nothing else here for me.","");
break;